/**
 * \file kernel/arch/x86/task.c
 * \author Davide Gessa
 * \date 10-19-09
 */
#include <arch.h>


/**
 * Entra in user mode
 */
void task_switch_to_user_mode()
{
	asm volatile("cli; \
     mov $0x23, %ax; \
     mov %ax, %ds; \
     mov %ax, %es; \
     mov %ax, %fs; \
     mov %ax, %gs; \
                   \
     mov %esp, %eax; \
     pushl $0x23; \
     pushl %eax; \
     pushf; \
     pushl $0x1B; \
     push $1f; \
     iret; \
   1: \
     ");
}
